package com.xiaoshuidi.cloud.module.report.convert.ajreport;

import com.xiaoshuidi.cloud.framework.common.pojo.PageResult;
import com.xiaoshuidi.cloud.module.report.controller.ajreport.vo.ReportPaymentData;
import com.xiaoshuidi.cloud.module.report.controller.ajreport.vo.ReportPaymentDetailsExportVO;
import com.xiaoshuidi.cloud.module.report.controller.ajreport.vo.ReportPaymentDetailsRespVO;
import com.xiaoshuidi.cloud.module.report.dal.DO.report.ReportPaymentDetailsDO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * 收款明细表转换类
 */
@Mapper
public interface ReportPaymentDetailsConvert {

    ReportPaymentDetailsConvert INSTANCE = Mappers.getMapper(ReportPaymentDetailsConvert.class);
    @Mapping(target = "isConcentrated",expression = "java(infoDO.getIsConcentrated()?\"集中社区\":\"分散社区\" )")
    @Mapping(target = "isWhole",expression = "java(infoDO.getIsWhole()?\"整租\":\"合租\" )")
    ReportPaymentData convert(ReportPaymentDetailsDO infoDO);

    @Mapping(target = "isConcentrated",expression = "java(infoDO.getIsConcentrated()?\"集中社区\":\"分散社区\" )")
    @Mapping(target = "isWhole",expression = "java(infoDO.getIsWhole()?\"整租\":\"合租\" )")
    ReportPaymentDetailsExportVO convertExport(ReportPaymentDetailsDO infoDO);


    PageResult<ReportPaymentData> convertPage(PageResult<ReportPaymentDetailsDO> page);

    List<ReportPaymentDetailsExportVO> convertList(List<ReportPaymentDetailsDO> list);

}

